home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Samples / SampleCode / Plug-in - QuickDraw Renderer / IRS_Methods.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-14  |  3.9 KB  |  173 lines  |  [TEXT/CWIE]

  1. /******************************************************************************\
  2.                                                                         
  3.         Module:        IRS_Methods.c                                            
  4.                                                                             
  5.         Purpose:     renderer top level QD3D metahandler functions                                
  6.                                                                         
  7.         Author:        Sun-Inn Shih                                        
  8.                                                                         
  9.         Copyright (C) 1993-96 Apple Computer, Inc.  All rights reserved.    
  10.                                                                             
  11. \*****************************************************************************/
  12. #include <stdlib.h>
  13. #include <stdio.h>
  14. #include <QD3D.h>
  15. #include <QD3DGeometry.h>
  16. #include <QD3DView.h>
  17. #include <QD3DDrawContext.h>
  18. #include "IRS_Methods.h"
  19.  
  20. /*===========================================================================*\
  21.  *
  22.  *    Routine:    PFNew()
  23.  *
  24.  *    Comments:    
  25.  *
  26. \*===========================================================================*/
  27.  
  28. TQ3Status IRSNew(
  29.     TQ3RendererObject        pRenderer,
  30.     irsData                    *irsdata,
  31.     void                    *pInitData)
  32. {
  33.     (void)(pInitData);
  34.     (void)(pRenderer);
  35.     return kQ3Success;
  36. }
  37.     
  38. /*===========================================================================*\
  39.  *
  40.  *    Routine:    PFDelete()
  41.  *
  42.  *    Comments:    
  43.  *
  44. \*===========================================================================*/
  45.  
  46. void IRSDelete(
  47.     TQ3RendererObject         pRenderer,
  48.     irsData                    *irsdata)
  49. {
  50.     (void)(pRenderer);
  51.     (void)(irsdata);
  52.  
  53. }
  54.  
  55. /*===========================================================================*\
  56.  *
  57.  *    Routine:    IRSStartFrame()
  58.  *
  59.  *    Comments:    
  60.  *
  61. \*===========================================================================*/
  62.  
  63. TQ3Status IRSStartFrame(
  64.     TQ3ViewObject            pView,
  65.     irsData                    *irsdata,
  66.     TQ3DrawContextObject    pQD3DDrawContext)
  67.     {
  68.     TQ3DrawContextObject DrawContext ;
  69.     if ( Q3View_GetDrawContext ( pView , &DrawContext ) != kQ3Failure )
  70.         {
  71.         TQ3DrawContextData Data ;
  72.         if ( Q3DrawContext_GetData ( DrawContext , &Data ) != kQ3Failure )
  73.             {
  74.             Rect R ;
  75.             R.left = Data.pane.min.x ;
  76.             R.right = Data.pane.max.x ;
  77.             R.top = Data.pane.min.y ;
  78.             R.bottom = Data.pane.max.y ;
  79.             CWindowPtr Window ;
  80.             if ( Q3MacDrawContext_GetWindow ( DrawContext , &Window ) != kQ3Failure )
  81.                 {
  82.                 SetPort ( ( GrafPort* ) ( Window ) ) ;
  83.                 EraseRect ( &R ) ; //Window->portRect ) ;
  84.                 }
  85.             }
  86.         } ;
  87. /*    if(irsdata->filePtr == NULL)
  88.         {
  89.         irsdata->filePtr = fopen("IRShelloutput.ps", "w");
  90.         }
  91.  
  92.     fprintf(irsdata->filePtr, "%%!PS-Adobe-3.0\n");
  93.     fprintf(irsdata->filePtr, "0 setgray\n");
  94.     fprintf(irsdata->filePtr, "1 setlinecap\n");
  95.     fprintf(irsdata->filePtr, "1 setlinejoin\n");
  96. */
  97.     return kQ3Success;
  98.     }
  99.  
  100. /*===========================================================================*\
  101.  *
  102.  *    Routine:    IRSEndFrame()
  103.  *
  104.  *    Comments:    
  105.  *
  106. \*===========================================================================*/
  107.  
  108. TQ3Status IRSEndFrame(
  109.                         TQ3ViewObject            pView,
  110.                         irsData                    *irsdata,
  111.                         TQ3DrawContextObject    pQD3DDrawContext)
  112.     {
  113.     /*
  114.     if(irsdata->filePtr != NULL)
  115.         {
  116.         fprintf(irsdata->filePtr, "stroke\n");
  117.         fprintf(irsdata->filePtr, "showpage\n");
  118.         fclose(irsdata->filePtr);
  119.         irsdata->filePtr = NULL;
  120.         }
  121.         */
  122.     return kQ3Success;
  123.     }
  124.  
  125. /*===========================================================================*\
  126.  *
  127.  *    Routine:    IRSStartPass()
  128.  *
  129.  *    Comments:    
  130.  *
  131. \*===========================================================================*/
  132.  
  133. TQ3Status IRSStartPass(
  134.     TQ3ViewObject            pView,
  135.     irsData                    *irsdata,
  136.     TQ3CameraObject            pCamera,
  137.     TQ3GroupObject            pLightGroup)
  138. {
  139.     return kQ3Success;
  140. }
  141.  
  142. /*===========================================================================*\
  143.  *
  144.  *    Routine:    IRSEndPass()
  145.  *
  146.  *    Comments:    
  147.  *
  148. \*===========================================================================*/
  149.  
  150. TQ3ViewStatus IRSEndPass(
  151.     TQ3ViewObject            pView,
  152.     irsData                    *irsdata)
  153. {
  154.     return kQ3ViewStatusDone;
  155. }
  156.  
  157.  
  158. /*===========================================================================*\
  159.  *
  160.  *    Routine:    IRSCancel()
  161.  *
  162.  *    Comments:    
  163.  *
  164. \*===========================================================================*/
  165.  
  166. void IRSCancel(
  167.     TQ3ViewObject             pView,
  168.     irsData                    *irsdata)
  169. {
  170.     (void)(pView);
  171. }
  172.     
  173.